#ifndef CDBEditH
#define CDBEditH
//---------------------------------------------------------------------------
#include "CtrlDB.h"
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <DBCtrls.hpp>
#include <Mask.hpp>
#include <StdCtrls.hpp>
//---------------------------------------------------------------------------
class PACKAGE_CTRLDB CDBEdit : public TDBEdit
{
private:
  AnsiString                m_Libelle;
  TLabel                   *m_Label;
  int                       m_SizeEspace;
  TFont                    *m_LibelleFont;
  bool                      m_LblFontChange;
  bool                      m_Obligatoire;
  TCorrectementRempliEvent  m_pfnOnEstCorrectementRempli;
  bool                      m_BleuSiHint;

  bool __fastcall GetEnabled(void);
  bool __fastcall GetReadOnly(void);

  void __fastcall SetLibellePos(void);
  void __fastcall SetEnabled(bool value);
  void __fastcall SetReadOnly(bool value);
  void __fastcall SetSizeEspace(int value);
  void __fastcall SetLibelleFont(TFont *value);
  void __fastcall SetLibelle(const AnsiString value);
  void __fastcall SetLibelleFontChange(TObject *Sender);
  void __fastcall SetLibelleFontMessage(TFont *value);

  void __fastcall SetVisible( bool bVisible);
  bool __fastcall GetVisible() const;
  void __fastcall SetObligatoire( bool bObligatoire);
  void __fastcall SetBleuSiHint( bool bBleuSiHint);

protected:
  DYNAMIC void __fastcall Change(void);
  void __fastcall WMSetFont         ( TWMSetFont          &Msg);
  void __fastcall WMSetFocus        ( TWMSetFocus         &Msg);
  void __fastcall WMWindowPosChanged( TWMWindowPosChanged &Msg);
  void __fastcall WMChar            ( TWMChar             &Msg);
  BEGIN_MESSAGE_MAP
   MESSAGE_HANDLER(WM_SETFONT         , TWMSetFont         , WMSetFont         )
   MESSAGE_HANDLER(WM_SETFOCUS        , TWMSetFocus        , WMSetFocus        )
   MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, TWMWindowPosChanged, WMWindowPosChanged)
   MESSAGE_HANDLER(WM_CHAR            , TWMChar            , WMChar            )
  END_MESSAGE_MAP(TDBEdit)

public:
    __fastcall  CDBEdit(TComponent* Owner);
    virtual __fastcall ~CDBEdit(void);
    bool __fastcall EstCorrectementRempliDefault( void);
__published:
  __property bool        Enabled      = { read=GetEnabled    , write=SetEnabled     , default=true     };
  __property AnsiString  Libelle      = { read=m_Libelle     , write=SetLibelle                        };
  __property TFont      *LibelleFont  = { read=m_LibelleFont , write=SetLibelleFont                    };
  __property bool        ReadOnly     = { read=GetReadOnly   , write=SetReadOnly    , default=false    };
  __property int         SizeEspace   = { read=m_SizeEspace  , write=SetSizeEspace  , default=10       };
  __property bool        Visible      = { read=GetVisible    , write=SetVisible     , default = true   };
  __property bool        Obligatoire  = { read=m_Obligatoire , write=SetObligatoire , default = false  };

  __property TCorrectementRempliEvent OnEstCorrectementRempli = { read = m_pfnOnEstCorrectementRempli, write = m_pfnOnEstCorrectementRempli};
  __property bool        BleuSiHint   = { read=m_BleuSiHint  , write=SetBleuSiHint  , default = false  };

};
//---------------------------------------------------------------------------
#endif
